﻿<Window x:Class="Library.Windows.Authors"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:local="clr-namespace:Library.Windows"
        mc:Ignorable="d"
        Title="Авторы" Height="650" Width="800"
        WindowStartupLocation="CenterScreen"
        WindowStyle="ToolWindow"
        MinHeight="650" MinWidth="800"
        MaxHeight="650" MaxWidth="800">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200"/>
            <ColumnDefinition Width="*"/>
        </Grid.ColumnDefinitions>

        <GroupBox Header="Добавление нового автора"
                    x:Name="GroupHeader"
                    Margin="5">
            <StackPanel>
                <Label Content="Фамилия"/>
                <TextBox x:Name="lastName"/>

                <Label Content="Имя"/>
                <TextBox x:Name="firstName"/>

                <Label Content="Отчество"/>
                <TextBox x:Name="patronymicName"/>

                <Label Content="Краткая информация"/>
                <TextBox x:Name="descriptionAuthor"/>

                <Button Content="Добавить автора"
                Width="150" HorizontalAlignment="Right"
                Margin="10 10"
                x:Name="addAuthor"
                Click="addAuthor_Click"/>
            </StackPanel>
        </GroupBox>
        <StackPanel Grid.Column="1">
            <GroupBox Header="Список авторов"
                    Margin="5">
                <ListBox x:Name="listAuthors"
                    Height="300"
                    SelectionChanged="listAuthors_SelectionChanged">
                    <ListBox.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Изменить"
                                      x:Name="ChangeRow"
                                      Click="ChangeRow_Click"/>
                        </ContextMenu>
                    </ListBox.ContextMenu>
                </ListBox>
            </GroupBox>
            <TextBlock Text="{Binding StringFormat=Количество строк {0}, 
                ElementName=listAuthors, Path=Items.Count}"/>
            <GroupBox Header="Информация о авторе">
                <StackPanel>
                    <Label Content="Фамилия"/>
                    <TextBlock x:Name="infoLastName"
                        Style="{StaticResource ResourceKey=info}"/>

                    <Label Content="Имя"/>
                    <TextBlock x:Name="infoFirstName"
                        Style="{StaticResource ResourceKey=info}"/>

                    <Label Content="Отчество"/>
                    <TextBlock x:Name="infoPatronymic"
                        Style="{StaticResource ResourceKey=info}"/>

                    <Label Content="Краткая информация"/>
                    <TextBlock x:Name="infoDescription" Height="80"
                        Style="{StaticResource ResourceKey=info}"/>
                </StackPanel>
            </GroupBox>
        </StackPanel>
    </Grid>
</Window>
